<template>
  <div>
    <ul v-if="list.length" class="list">
      <li>
        <div>
          <img src="../../../static/mine/book.jpg" alt="">
          <div class="name">平视姚明</div>
          <div class="author">王猛</div>
        </div>
      </li>
      <li>
        <div>
          <img src="../../../static/mine/book.jpg" alt="">
          <div class="name">平视姚明</div>
          <div class="author">王猛</div>
        </div>
      </li>
      <li>
        <div>
          <img src="../../../static/mine/book.jpg" alt="">
          <div class="name">平视姚明</div>
          <div class="author">王猛</div>
        </div>
      </li>
      <li>
        <div>
          <img src="../../../static/mine/book.jpg" alt="">
          <div class="name">平视姚明</div>
          <div class="author">王猛</div>
        </div>
      </li>
      <li>
        <div>
          <img src="../../../static/mine/book.jpg" alt="">
          <div class="name">平视姚明</div>
          <div class="author">王猛</div>
        </div>
      </li>
      <li>
        <div>
          <img src="../../../static/mine/book.jpg" alt="">
          <div class="name">平视姚明</div>
          <div class="author">王猛</div>
        </div>
      </li>
    </ul>
    <div v-else class="hasnolist">
      还没有卖过书
      <div>
        <div class="goBuyBook" @click="goBuyBook">去卖书</div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      index: '0',
      list: [1]
    }
  },
  methods: {
    goBuyBook() {
      wx.redirectTo({
        url: '../index/main'
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.list {
    display: flex;
    flex-wrap: wrap;
    padding: 18rpx;
    li {
        width: 238rpx;
        border-bottom: 1rpx solid #eee;
        & > div {
            margin: 20rpx auto;
            width: 150rpx;
            overflow: hidden;
        }
        img {
            width: 150rpx;
            height: 205rpx;
            display: block;
        }
        .name {
            margin-top: 10rpx;
            height: 50rpx;
            line-height: 50rpx;
            font-size: 32rpx;
            color: #000;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .author {
            height: 40rpx;
            font-size: 24rpx;
            color: #666;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
    }
}
.hasnolist {
    text-align: center;
    margin-top: 200rpx;
    font-size: 28rpx;
    color: #666;
}
.goBuyBook {
    margin: 20rpx auto;
    width: 150rpx;
    height: 60rpx;
    line-height: 60rpx;
    font-size: 16px;
    color: #c78650;
    border: 1rpx solid #c78650;
    border-radius: 10rpx;
}
</style>

